package com.shop2cn.iapi.prodstockmgr.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.prodstockmgr.parameter.ExecuteBean;
import com.shop2cn.iapi.prodstockmgr.service.ExecuteCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
/**
*执行任务Test
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_Execute{
	private static ExecuteBean executeBean;
	private static ExecuteCall executeCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("执行任务Test");
	}

	@Before
	public void caseUp() {
		executeBean=new ExecuteBean();
		executeCall=new ExecuteCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(executeCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_Execute_001() {
		Logger.start(true,"正确数据，成功");
		try {
			executeCall.setData(executeBean);
			executeCall.callService();			
			Logger.verifyEquals("ok", executeCall.getReturnData(), "验证code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}